package org.ResearchProject.controller;

import org.ResearchProject.dto.Result;
import org.ResearchProject.pojo.Student;
import org.ResearchProject.pojo.User;
import org.ResearchProject.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 学生查询
 */
@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    StudentService studentService;
    /**
     * 查询所有学生
     * 2024-12-13-16:09
     */
    @RequestMapping(value = "/selectAll",method = RequestMethod.GET)
    public Result selectAll(){
        return Result.success(studentService.selectAll());
    }

    /**
     * 条件查询学生
     */
    @RequestMapping(value = "/conditionSelect",method = RequestMethod.GET)
    public Result conditionSelect(@RequestBody Student student){
        System.out.println(student);
        System.out.println(studentService.conditionSelect(student));
        return Result.success(studentService.conditionSelect(student));
    }

}


